package com.liu.design.structure.proxy.statics;

/**
 * @author LIU
 * @version 1.0
 * @date 2022/12/19 16:10
 * @description: 静态代理
 *
 */
public class TargetProxy implements TargetInterface {

    private Target target;

    public TargetProxy(Target target) {
        this.target = target;
    }

    @Override
    public void coreWork() {
        before();
        target.coreWork();
        after();
    }

    private void before() {
        System.out.println("前置增强");
    }

    private void after() {
        System.out.println("后置增强");
    }
}
